<?php
 

//
$a = 1.234;
$b = 1.2e3;
$c = 7E-10;

//$d =1_234.567; // 从 PHP 7.4.0 开始支持
$p="2.0";
$p=5;
$p=5.3;
$p="5p";
if(is_numeric($p)){
    
    echo "is numeric";
}else{
    echo "no numeric";
}
if(is_string($p)){
    
    echo " is string";
}else{
    echo " no string";
}

for ($i = 0; $i < 5; $i++) {
    
    echo rand(11,5)."  ";
    #rand()函数参数随机数,包括1,5
    #rand()
}
echo"\n";
for ($i = 0; $i < 5; $i++) {
    
    echo mt_rand(1,5)."  ";
    #rand()函数参数随机数,包括1,5
}
for ($i = 0; $i < 5; $i++) {
    
    echo rand()."  ";
    #64位 302369244  2047658746  2022680518 
  
}
echo"\n";
echo getrandmax();



echo"\n";
$o=1246874.655;

$p=number_format($o,2,';',"#");
//格式化的数,四舍五入保留小数位数,小数点符号,千分符
//一般前两个就够了
echo $p;
echo"\n";

echo floor($o);
echo"\n";

echo round($o);
echo"\n";

echo ceil($o);
echo"\n";

echo abs($o);
echo"\n";

$o=1246874;
echo decbin($o);
//decbin函数需要是整数,否则会报错
echo"\n";
echo dechex($o);
//dechex函数需要是整数,否则会报错
echo"\n";
echo bin2hex(decbin($o));


$aak=[1,5,3,7];
echo"\n";
echo min($aak);//min()函数或者数组的最小组
echo"\n";
echo max($aak);
echo"\n";
echo pi();
echo"\n";
echo  pow(5, 2);
echo"\n";
echo  pow(25, 0.5);
//pow函数可以求开方,也可以求密